<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>悬浮窗口示例</title> 
<style>
	.suspended {
		position: absolute;
		top: 0px;
		right: 0px;
		margin:10px;
		padding:5px;
		border: 1px solid #DDDDDD;
		background-color: #f0f0f0
	}
	.suspended div{
		padding:1px;
	}
</style>
<script type="text/javascript"> 
	window.onscroll = function() {
		var div = document.getElementById("suspendedDiv");
		div.style.top = document.body.scrollTop;
	}
	window.onresize = window.onscroll;

	function addNode(parent,text, href){
		var nodeDiv = document.createElement("div");
		var linkNode = document.createElement("a");
		linkNode.href = href;
		nodeDiv.appendChild(linkNode);
		linkNode.appendChild(document.createTextNode(text));
		if(typeof(parent)=='string'){
			parent = document.getElementById(parent);
		}
		parent.appendChild(nodeDiv);
	}
</script>
</head>
<body> 
	<div id="suspendedDiv"class="suspended">
		<div>这是悬浮窗口</div>
		<div>这是悬浮窗口</div>
	</div> 
<p id="xx">Try scrolling this window.</p> 
<p> Line 1</p>
<p> Line 2</p>
<p> Line 3</p>
<p> Line 4</p>
<p> Line 5</p>
<p> Line 6</p>
<p> Line 7</p>
<p> Line 8</p>
<p> Line 9</p>
<p> Line 10</p>
<p> Line 11</p>
<p> Line 12</p>
<p> Line 13</p>
<p> Line 1</p>
<p> Line 2</p>
<p> Line 3</p>
<p> Line 4</p>
<p> Line 5</p>
<p> Line 6</p>
<p> Line 7</p>
<p> Line 8</p>
<p> Line 9</p>
<p> Line 10</p>
<p> Line 11</p>
<p> Line 12</p>
<p> Line 13</p>
<p> Line 1</p>
<p> Line 2</p>
<p> Line 3</p>
<p> Line 4</p>
<p> Line 5</p>
<p> Line 6</p>
<p> Line 7</p>
<p> Line 8</p>
<p> Line 9</p>
<p> Line 10</p>
<p> Line 11</p>
<p> Line 12</p>
<p> Line 13</p>
<p> Line 1</p>
<p> Line 2</p>
<p> Line 3</p>
<p> Line 4</p>
<p> Line 5</p>
<p> Line 6</p>
<p> Line 7</p>
<p> Line 8</p>
<p> Line 9</p>
<p> Line 10</p>
<p> Line 11</p>
<p> Line 12</p>
<p> Line 13</p>
<p> Line 1</p>
<p> Line 2</p>
<p> Line 3</p>
<p> Line 4</p>
<p> Line 5</p>
<p> Line 6</p>
<p> Line 7</p>
<p> Line 8</p>
<p> Line 9</p>
<p> Line 10</p>
<p> Line 11</p>
<p> Line 12</p>
<p> Line 13</p>
<p> Line 1</p>
<p> Line 2</p>
<p> Line 3</p>
<p> Line 4</p>
<p> Line 5</p>
<p> Line 6</p>
<p> Line 7</p>
<p> Line 8</p>
<p> Line 9</p>
<p> Line 10</p>
<p> Line 11</p>
<p> Line 12</p>
<p> Line 13</p>
<p> Line 1</p>
<p> Line 2</p>
<p> Line 3</p>
<p> Line 4</p>
<p> Line 5</p>
<p> Line 6</p>
<p> Line 7</p>
<p> Line 8</p>
<p> Line 9</p>
<p> Line 10</p>
<p> Line 11</p>
<p> Line 12</p>
<p> Line 13</p>
<p> Line 1</p>
<p> Line 2</p>
<p> Line 3</p>
<p> Line 4</p>
<p> Line 5</p>
<p> Line 6</p>
<p> Line 7</p>
<p> Line 8</p>
<p> Line 9</p>
<p> Line 10</p>
<p> Line 11</p>
<p> Line 12</p>
<p> Line 13</p>
<p> Line 1</p>
<p> Line 2</p>
<p> Line 3</p>
<p> Line 4</p>
<p> Line 5</p>
<p> Line 6</p>
<p> Line 7</p>
<p> Line 8</p>
<p> Line 9</p>
<p> Line 10</p>
<p> Line 11</p>
<p> Line 12</p>
<p> Line 13</p>
<a name="aaa" />

<script>
	
	addNode('xx', 'aa', '#aaa');
	addNode('xx', 'aa', '#aaa');
	addNode('xx', 'aa', '#aaa');
	
</script>
</body> 
</html>
